package ltd.smallwang;

import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;

/**
 * @author smallwang
 * @email justdoalitter@gmail.com
 * @create date 2025-01-01 21:19:51
 * @modify date 2025-01-01 21:19:51
 * @desc [description]
 */
class Leetcode0048Test {
  private final Leetcode0048 leetcode0048 = new Leetcode0048();

  @Test
  void testRotate01() {
    int[][] input = { { '1', '2', '3' }, { '4', '5', '6' }, { '7', '8', '9' } };
    leetcode0048.rotate(input);
    Assertions.assertThat(input).isDeepEqualTo(new int[][] { { 7, 4, 1 }, { 8, 5, 2 }, { 9, 6, 3 } });
  }

  @Test
  void testRotate02() {
    int[][] input = { { 5, 1, 9, 11 }, { 2, 4, 8, 10 }, { 13, 3, 6, 7 }, { 15, 14, 12, 16 } };
    leetcode0048.rotate(input);
    Assertions.assertThat(input)
        .isDeepEqualTo(new int[][] { { 15, 13, 2, 5 }, { 14, 3, 4, 1 }, { 12, 6, 8, 9 }, { 16, 7, 10, 11 } });
  }

  @Test
  void testRotate03() {
    int[][] input = { { 1 } };
    leetcode0048.rotate(input);
    Assertions.assertThat(input).isDeepEqualTo(new int[][] { { 1 } });
  }
}
